<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>tablist</title>
    <link href="css/common.css" rel="stylesheet">
    <link href="css/ec.css" rel="stylesheet">
    <link href="css/list.css" rel="stylesheet">
    <link href="css/newInf.css" rel="stylesheet">
</head>
<body>
<div class="reportForm">
    <p class="save">
        <span><input type="button" value="导出Excel" class="red export" id="export"></span>
        <!--<a  download="table导出Excel" id="export" class="red export" href="#">导出Excel</a>-->
        <!--<span><input type="button" onclick="exportExcel('table')" value="导出Excel" class="red export"></span>-->
    </p>
    <table id="table1" class="reportTable">
        <tr class="reportTitle">
            <th colspan="10">中央控制系统报价 </th>
        </tr>
        <tr class="reportTxt warp">
            <td colspan="2"><span>项目名称</span>:</td>
            <td>项目名称</td>
            <td colspan="3"><span>报价单位</span>：</td>
            <td colspan="4">报价单位</td>
        </tr>
        <tr class="reportTxt warp">
            <td colspan="2"><span class="warpTop">地址</span>:</td>
            <td></td>
            <td colspan="3"><span>报价时间</span>：</td>
            <td colspan="4"></td>
        </tr>
        <tr>
            <td colspan="10">&nbsp;</td>
        </tr>
        <tr>
            <td class="warpCode"><span>A</span></td>
            <td colspan="9" class="warpCode">设备材料及安装</td>
        </tr>
        <tr>
            <th>序号</th>
            <th>品名</th>
            <th>描述</th>
            <th>型号</th>
            <th>单位</th>
            <th>数量</th>
            <th>单价(RMB)</th>
            <th>合计(RMB)</th>
            <th>品牌</th>
            <th class="warpImg">图片</th>
        </tr>
        <tr class="tableWarpImg">
            <td>1</td>
            <td>C4中央控制主机</td>
            <td>含MyHome項目授權 / Intercom音視頻對講授權 / TuneIn網絡電臺授權，</td>
            <td>C4-EA5</td>
            <td>台</td>
            <td>1</td>
            <td>12049.00</td>
            <td>12049.00</td>
            <td>C4</td>
            <td class="warpImg">
                <img src="http://test.file.yihanzn.com/upload/image/productBrand/2018/06/21/p1cggp8glv1rt7q8d1m3gi8m1jh43.jpg" />
            </td>
        </tr>
        <tr class="tableWarpImg">
            <td>2</td>
            <td>C4中央控制主机</td>
            <td>含MyHome項目授權 / Intercom音視頻對講授權 / TuneIn網絡電臺授權</td>
            <td>C4-EA1</td>
            <td>台</td>
            <td>1</td>
            <td>4725.00</td>
            <td>4725.00</td>
            <td>C4</td>
            <td class="warpImg"><img src="http://test.file.yihanzn.com/upload/image/seller/logo/2018/06/21/p1cggqf411cev1iri80b1tlbejt3.jpg" /></td>
        </tr>
        <tr class="tableWarpImg">
            <td>4</td>
            <td>C4中央控制主机</td>
            <td>含MyHome項目授權 / Intercom音視頻對講授權 / TuneIn網絡電臺授權</td>
            <td>C4-EA1</td>
            <td>台</td>
            <td>1</td>
            <td>4725.00</td>
            <td>4725.00</td>
            <td>C4</td>
            <td class="warpImg"><img src="http://test.file.yihanzn.com/upload/image/seller/logo/2018/06/21/p1cggqf411cev1iri80b1tlbejt3.jpg" /></td>
        </tr>
        <tr>
            <td>10</td>
            <td>本项小计</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td>7699.95</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td colspan="10">&nbsp;</td>
        </tr>
        <tr>
            <td class="warpCode"><span>B</span></td>
            <td colspan="9" class="warpCode">系统集成工程</td>
        </tr>
        <tr>
            <th>序号</th>
            <th>项目名称</th>
            <th colspan="2">名称释义</th>
            <th>单位</th>
            <th>数量</th>
            <th>单价(RMB)</th>
            <th>合计(RMB)</th>
            <th colspan="2">备注</th>
        </tr>
        <tr>
            <td>1</td>
            <td>GW联结费</td>
            <td colspan="2">Config Tools通讯框架</td>
            <td>组</td>
            <td>3</td>
            <td>150.00</td>
            <td>450.00</td>
            <td colspan="2">模块联结</td>
        </tr>
        <tr>
            <td>2</td>
            <td>搭建费</td>
            <td colspan="2">物理架构搭建</td>
            <td>次</td>
            <td>1</td>
            <td>0.10</td>
            <td>1749.95</td>
            <td colspan="2">设备项×5%</td>
        </tr>
        <tr>
            <td>9</td>
            <td>系统编程费</td>
            <td colspan="2">Composer</td>
            <td>次</td>
            <td>1</td>
            <td>5500.00</td>
            <td>5500.00</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td>10</td>
            <td colspan="6">本项小计</td>
            <td>7699.95</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="10">&nbsp;</td>
        </tr>
        <tr>
            <td class="warpCode"><span>C</span></td>
            <td colspan="9" class="warpCode">隐蔽工程</td>
        </tr>
        <tr>
            <th>序号</th>
            <th>品名</th>
            <th>描述</th>
            <th>型号</th>
            <th>单位</th>
            <th>数量</th>
            <th>单价(RMB)</th>
            <th>合计(RMB)</th>
            <th colspan="2">备注</th>
        </tr>
        <tr>
            <td>30</td>
            <td>控制线</td>
            <td>EIB电缆2*2*0.8</td>
            <td></td>
            <td>米</td>
            <td>50</td>
            <td></td>
            <td></td>
            <td colspan="2">EIB</td>
        </tr>
        <tr>
            <td>31</td>
            <td>六类网线</td>
            <td>超六类网络电缆</td>
            <td></td>
            <td>米</td>
            <td>200</td>
            <td></td>
            <td></td>
            <td colspan="2">天诚</td>
        </tr>
        <tr>
            <td>32</td>
            <td>	环氧板</td>
            <td>0.5cm 120*240cm</td>
            <td></td>
            <td>块</td>
            <td>1</td>
            <td></td>
            <td></td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td>33</td>
            <td>电源信号线</td>
            <td>RVV软线</td>
            <td></td>
            <td>米</td>
            <td>150</td>
            <td></td>
            <td></td>
            <td colspan="2">天诚</td>
        </tr>
        <tr>
            <td>4</td>
            <td>工程附件</td>
            <td>86预埋盒、吊筋、膨胀螺丝、弯头、直接等</td>
            <td></td>
            <td>套</td>
            <td>1</td>
            <td></td>
            <td></td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td> 5</td>
            <td colspan="6">本项小计</td>
            <td>0.00</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="10">&nbsp;</td>
        </tr>
        <tr>
            <th class="warpCode"><span>D</span></th>
            <th colspan="6">合计（A+B+C）</th>
            <th colspan="3">42698.95</th>
        </tr>
    </table>
</div>


</body>
<script src="js/jquery-1.4.2.min.js"></script>
<script src="js/jquery.table2excel1.js"></script>
<!--<script src="../plugin/jquery/jquery.base64.js"></script>-->
<!--<script src="../plugin/export/exportExcel.js"></script>-->
<script type="text/javascript">
    // 导出Excel
    $(function() {
        $(".export").click(function(){
            $(".reportTable").table2excel({
                // 不被导出的表格行的CSS class类
                exclude: ".noExl",
                // 导出的Excel文档的名称
                name: "Excel1",
                // Excel文件的名称
                filename: "成绩单.xls",
                //文件后缀名
                fileext: ".xls",
                //是否排除导出图片
                exclude_img: false,
                //是否排除导出超链接
                exclude_links: false,
                border:1,
                //是否排除导出输入框中的内容
                exclude_inputs: false
            });

        });
    });
</script>

<script>
    // 图片处理
    /*
     $("<img/>")这里是创建一个临时的img标签，类似js创建一个new Image()对象！
     如果要获取图片的真实的宽度和高度有三点必须注意
     1、需要创建一个image对象：如这里的$("<img/>")
     2、指定图片的src路径
     3、一定要在图片加载完成后执行如.load()函数里执行
     */
    photo = function ($obj,a,b) {
        $obj.each(function () {
            var w, h,wImg, hImg, img = $(this);
            var num = a/b;
            $("<img/>").attr("src", $(img).attr("src")).load(function() {
                wImg = this.width;
                hImg = this.height;
                // w = document.body.offsetWidth;
                // h = document.body.offsetHeight;
                // console.log(w+'   '+h);
                if(wImg/hImg > num){
                    img.css({height:'auto',width:a+'px'});
                }else{
                    img.css({height:b+'px',width:'auto'});
                }
            });

        })
    };
    // 控制图片大小
    photo($('.warpImg img'),150,120);

</script>
</html>